using UnityEngine;
using System.Collections;

public class Camera : MonoBehaviour {
	
	public Transform Alvo;
	float h;

	// Use this for initialization
	void Start () {
		h = 30;
	}
	
	// Update is called once per frame
	void Update () {
		this.transform.LookAt(Alvo);
		if(Input.GetKey(KeyCode.W)){
			this.transform.Translate(new Vector3(0, 0, 1));
		}else if(Input.GetKey(KeyCode.S)){
			this.transform.Translate(new Vector3(0, 0, -1));
		}
		if(Input.GetKey(KeyCode.A)){
			this.transform.Translate(new Vector3(-1, 0, 0));
		}else if(Input.GetKey(KeyCode.D)){
			this.transform.Translate(new Vector3(1, 0, 0));
		}
		if(Input.GetKey(KeyCode.Space)){
			h += 1;
		}else if(Input.GetKey(KeyCode.LeftShift)){
			h -= 1;
		}
		this.transform.position = new Vector3(this.transform.position.x, h, this.transform.position.z);
	}
}
